package com.expressage.service.impl;


import com.expressage.dao.AreaAddressDao;
import com.expressage.po.AreaAddress;
import com.expressage.service.AreaAddressService;
import com.expressage.vo.AreaAddressVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 区地址业务逻辑实现类
 */
@Service
public class AreaAddressServiceImpl implements AreaAddressService {

    @Autowired
    AreaAddressDao areaAddressDao;

    @Override
    public List<AreaAddressVO> findAll() {
        return areaAddressDao.findAll();
    }

    @Override
    public AreaAddressVO findByAreaid(int areaid) {
        return areaAddressDao.findByAreaid(areaid);
    }

    @Override
    public List<AreaAddress> findByCityid(int cityid) {
        return areaAddressDao.findByCityid(cityid);
    }

    @Override
    public AreaAddressVO findByAreaName(String name) {
        return areaAddressDao.findByAreaName(name);
    }

    @Override
    public boolean insert(AreaAddressVO areaAddress) {
        return areaAddressDao.insert(areaAddress)>0?true:false;
    }

    @Override
    public boolean delete(int[] areaid) {
        return areaAddressDao.delete(areaid)>0?true:false;
    }

    @Override
    public boolean update(AreaAddressVO areaAddress) {
        return areaAddressDao.update(areaAddress)>0?true:false;
    }
}
